package app.server.project.main.service.dto.recharge;

import app.server.project.main.service.db.entity.cfg.TaskCfgEntity;
import app.server.project.main.service.db.entity.user.UserTaskEntity;
import cn.hutool.core.bean.BeanUtil;
import lombok.Data;

@Data
public class TaskInfoDto {

    private int id;
    /**
     * 赛道id
     */
    private int raceId;

    /**
     * 代币数量
     */
    private long raceVal;

    /**
     * 体力值奖励
     */
    private long energy;
    /**
     * 排序字段
     */
    private int orderIndex;

    /**
     * 分享链接
     */
    private String url;

    private int status;


    private String des;


    private String img;

    public static TaskInfoDto of(TaskCfgEntity object, UserTaskEntity userTask) {
        var ret = new TaskInfoDto();
        BeanUtil.copyProperties(userTask, ret, true);
        BeanUtil.copyProperties(object, ret, true);
        return ret;
    }
}
